//
//  CCCommentModel.h
//  Activity
//
//  Created by its on 15/5/21.
//  Copyright (c) 2015年 coco. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Mantle/Mantle.h>
#import <ReactiveCocoa/ReactiveCocoa.h>
#import <AVOSCloud/AVOSCloud.h>
#import "CCError.h"
@class CCPublicComment;
@interface CCCommentModel : NSObject

/**
 *  获取评论列表
 *
 *  @param limit 获取评论的数目，默认是10
 *  @param id 活动id
 *
 *  @return
 */
- (RACSignal *) getCommentList:(int) limit activity:(NSString *)activity;

/**
 *  获取评论列表
 *
 *  @param limit    获取评论的数目，默认是10
 *  @param activity 活动
 *  @param after    评论的id
 *
 *  @return <#return value description#>
 */
- (RACSignal *) getCommentList:(int)limit activity:(NSString *)activity after:(NSString *)after;
/**
 *  发表评论
 *
 *  @param comment 评论的数据
 *
 *  @return
 */
- (RACSignal *) publicComment:(CCPublicComment *) comment;
/**
 *  发送回复通知给活动的发布人
 *
 *  @param dic   通知的内容
 *  @param userid 发布人
 *
 *  @return <#return value description#>
 */
- (RACSignal *) publicPrivateMessage:(NSDictionary *)dic userid:(NSString *)userid;

/**
 *  发送评论通知给活动的发布人
 *
 *  @param dic    通知的内容
 *  @param userid 发布人
 *
 *  @return <#return value description#>
 */
- (RACSignal *) publicCommentMessage:(NSDictionary *) dic userid:(NSString *)userid;

@end

@interface CCComment : MTLModel <MTLJSONSerializing>
@property (nonatomic, copy) NSString *author;
@property (nonatomic, copy) NSString *authorid;
@property (nonatomic, copy) NSString *head;
@property (nonatomic, copy) NSString *commentAuthor;
@property (nonatomic, copy) NSString *commentAuthorId;
@property (nonatomic, copy) NSString *comment;
@property (nonatomic, copy) NSNumber *upCount;
@property (nonatomic, copy) NSArray * upid;
@property (nonatomic, copy) NSString *objectid;
- (RACSignal *) up;
@end

/**
 *  评论的数据
 */
@interface CCPublicComment : NSObject
@property (nonatomic, strong) AVUser *author; // 作者
@property (nonatomic, strong) AVObject *parent; //评论谁的评论
@property (nonatomic, strong) NSString *content;  // 评论的内容
@property (nonatomic, strong) NSString *activity; // 评论所属的活动
@property (nonatomic, assign) int upCount;
@property (nonatomic, assign) NSArray *upArray;
@end